2020-2021 Sunseeker Telemetry and Lighting System
adc10_a_ex3_windowComp.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define High_Threshold   818
 
#define Low_Threshold   409
 
#define SlowToggle_Period   20000 - 1
 
#define FastToggle_Period   1000 - 1
 

Functions

void main (void)
 
void ADC10_A_ISR (void)
 
void TIMER0_B0_ISR (void)
 

Variables

Timer_B_initUpModeParam paramB2 = {0}
 

Macro Definition Documentation

◆ FastToggle_Period

#define FastToggle_Period   1000 - 1

Definition at line 78 of file adc10_a_ex3_windowComp.c.

◆ High_Threshold

#define High_Threshold   818

ADC10_A - Sample A1 Input, Window Comparator, 2.5V Internal Ref, TB0 Trigger

MSP430F550x Demo A1 is sampled in every 0.5s using the TA0.0 trigger in single ch/conversion mode. Window comparator is used to generate interrupts to indicate when the input voltage goes above the High_Threshold or below the Low_Threshold or is in between the high and low thresholds. TIMER_B0 is used as an interval timer used to control the LED at P1.0 to toggle slow/fast or turn off according to the ADC10_A Hi/Lo/IN interupts. ADC10_A is configured in pulse sample mode and is triggered by the TA0.0

         MSP430F550x
      -----------------
  /|\|              XIN|-
   | |                 |
   --|RST          XOUT|-
     |          P6.1/A1|<- Sample Signal
     |             P1.0|-> LED [toggle slow/fast or turn off]
     |                 |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • ADC10_A peripheral
  • REF peripheral
  • TIMER_B peripheral
  • GPIO Port peripheral
  • A1

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • ADC10_A_VECTOR
  • TIMER0_B0_VECTOR

Definition at line 73 of file adc10_a_ex3_windowComp.c.

◆ Low_Threshold

#define Low_Threshold   409

Definition at line 75 of file adc10_a_ex3_windowComp.c.

◆ SlowToggle_Period

#define SlowToggle_Period   20000 - 1

Definition at line 77 of file adc10_a_ex3_windowComp.c.

Function Documentation

◆ ADC10_A_ISR()

void ADC10_A_ISR ( void  )

◆ main()

◆ TIMER0_B0_ISR()

void TIMER0_B0_ISR ( void  )

Definition at line 270 of file adc10_a_ex3_windowComp.c.

Variable Documentation

◆ paramB2

Timer_B_initUpModeParam paramB2 = {0}

Definition at line 80 of file adc10_a_ex3_windowComp.c.

Referenced by ADC10_A_ISR(), and main().